//
//  MDHCommonItemViewModel.swift
//  JSTech
//
//  Created by 高得华 on 2019/5/8.
//  Copyright © 2020 华&梅. All rights reserved.
////  基类 （icon + title + subTitle）

import UIKit


////  基类 （icon + title + subTitle）
class MDHCommonItemViewModel: MDHPTModel {
    //MARK: - ===
    ///选中的标识
    @objc var ID = 0
    /// 图标
    @objc var icon = ""
    /// 标题
    @objc dynamic var title = ""
    /// 子标题
    @objc dynamic var subtitle = ""
    /// placeholder
    @objc var placeholder = ""
    
    ///
    fileprivate var _rowHeight: CGFloat = 44.0
    /// rowHeight , default is 44.0f
    @objc dynamic var rowHeight: CGFloat {
        set {
            _rowHeight = newValue
        }
        get {
            return _rowHeight*kMDHPTAutoScale()
        }
    }
    // default is UITableViewCellSelectionStyleGray.
    @objc var selectionStyle = UITableViewCell.SelectionStyle.none
   
    /// 右边显示的数字标记
    @objc dynamic var badgeValue: NSAttributedString = NSAttributedString()
    
    /// 中间偏左icon的图片名字
    @objc var centerLeftViewName = ""
    /// 中间偏右icon的图片名字
    @objc var centerRightViewName = ""
    
    /// 点击这行cell，需要调转到哪个控制器的视图模型 destViewModelClass：必须是MDHViewModel的子类
    @objc var destViewModelClass = ""
    
    /// 封装点击这行cell想做的事情
    @objc var operation: VoidBlock?
    /// 封装点击这行cell想做的事情
    @objc var blockBackData: VoidBlock_id?
    
    @objc convenience init(title: String, icon: String = "") {
        self.init()
        self.title = title
        self.icon  = icon
    }
    
    ///初始化
    @objc override init() {
        super.init()
        self.rowHeight = 54.0
        self.selectionStyle = .gray
    }
}
